{{ $data := index .Site.Data .Site.Language.Lang }}
<!-- footer -->
<footer>
  <!-- main footer -->
  <div class="section bg-secondary">
    <div class="container">
      <div class="row justify-content-between">
        <!-- footer content -->
        <div class="col-lg-5 mb-5 mb-lg-0">
          <!-- logo -->
          <a class="mb-4 d-inline-block" href="{{ .Site.BaseURL | relLangURL }}"><img class="img-fluid"
              src="{{ .Site.Params.logo_footer | relURL }}" alt="{{ .Site.Title }}" width="60%"></a>
          <p class="text-light mb-5">{{ .Site.Params.footer_content | markdownify }}</p>
          <h4 class="text-white mb-4">{{ i18n "follow" }}</h4>
          <!-- social links -->
          <ul class="list-inline social-icon-alt">
            {{ range .Site.Params.social }}
            <li class="list-inline-item">
              <a class="hover-ripple" href="{{ .link | safeURL }}"><i class="fa {{ .icon }}"></i></a>
            </li>
            {{ end }}
          </ul>
        </div>
        <div class="col-lg-5 mb-5 mb-lg-0">
            <!-- service list -->
            <!-- hide this -->
            <!--
            <div class="col-6 mb-5">
              <h4 class="text-white mb-4">{{ i18n "services" }}</h4>
              <ul class="list-styled">
                {{ range (where .Site.RegularPages "Type" "service")}}
                <li class="mb-3 text-light"><a class="text-light d-block" href="{{ .Permalink | relURL }}">{{ .Title }}</a>
                </li>
                {{ end }}
              </ul>
            </div>
            -->
            <!-- contact info -->
            {{ with $data.homepage.contact }}
            <div class="mb-5">
              <h4 class="text-white mb-4">{{ i18n "contact_info"}}</h4>
              <p class="text-light mb-3">{{ .address | markdownify }}</p>
              <p class="text-light mb-3">{{ .email | markdownify }}</p>
              <p class="text-light mb-3">{{ .description| markdownify }}</p>
              <p class="text-light mb-3"><img src="{{ .image | relURL }}" width="356px"></p>
            </div>
            {{ end }}
            {{ if .Site.Params.subscription.enable }}
            {{ with .Site.Params.subscription }}
            <div class="col-12">
              <h4 class="text-white mb-4">{{ i18n "subscribe_newsletter"}}</h4>
              <form action="{{ .mailchimp_form_action }}" method="post" name="mc-embedded-subscribe-form"
                target="_blank">
                <div class="position-relative">
                  <input type="email" class="form-control border-0 text-white newsletter-form" id="newsletter"
                    name="newsletter" placeholder="Enter your email">
                  <button type="submit" name="subscribe"
                    class="btn btn-primary btn-subscribe">{{ i18n "subscribe"}}</button>
                  <div style="position: absolute; left: -5000px;" aria-hidden="true">
                    <input type="text" name="{{ .mailchimp_form_name }}" tabindex="-1">
                  </div>
                </div>
              </form>
            </div>
            {{ end }}
            {{ end }}
        </div>
      </div>
    </div>
  </div>
  <!-- copyright -->
  <div class="bg-secondary-darken py-4">
    <div class="container">
      <div class="row">
        <div class="col-md-6 text-center text-md-left mb-3 mb-md-0">
          <p class="mb-0 text-white">{{ .Site.Params.copyright | markdownify }}</p>
        </div>
        <div class="col-md-6 text-center text-md-right">
          <ul class="list-inline">
            {{ range .Site.Menus.footer }}
            <li class="list-inline-item mx-0"><a class="d-inline-block px-3 text-white" href="{{ .URL | relLangURL }}"
                class="text-white">{{ .Name }}</a></li>
            {{ end }}
          </ul>
        </div>
      </div>
    </div>
  </div>
</footer>
<!-- /footer -->

{{ if .Site.Params.search }}
<script>
  var indexURL = {{ "index.json" | relURL}}
</script>
{{ end }}

{{ "<!-- JS Plugins -->" | safeHTML }}
{{ range .Site.Params.plugins.js}}
<script src="{{ .link | relURL }}"></script>
{{ end }}

{{ "<!-- Main Script -->" | safeHTML }}
{{ $script := resources.Get "js/script.js" | minify}}
<script src="{{ $script.Permalink | relURL }}"></script>

{{ "<!-- Algolia -->" | safeHTML }}
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2.6.3/dist/cdn/docsearch.min.js"></script>
<script>
  docsearch({
    apiKey: '870a8addaf7a712ecc6e33ce9def93b1',
    indexName: 'DocSearch',
    appId: '2506Q6I4IV',
    inputSelector: '#js-algolia-btn',
    debug: false,
  });
</script>

{{ "<!-- google analitycs -->" | safeHTML }}
{{ with .Site.Params.google_analitycs_id}}
<script>
  (function (i, s, o, g, r, a, m) {
    i['GoogleAnalyticsObject'] = r;
    i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments)
    }, i[r].l = 1 * new Date();
    a = s.createElement(o),
      m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src = g;
    m.parentNode.insertBefore(a, m)
  })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
  ga('create', '{{ . }}', 'auto');
  ga('send', 'pageview');
</script>
{{ end }}
